<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
            * {
                margin: 0;
                padding: 0;
            }
    
            body,
            html {
                width: 100%;
                height: 100%;
                background-color: #000;
            }
        </style>
</head>
<body>
    <canvas id="cvs"></canvas>
    <script>
        var cvs = document.getElementById("cvs");
        cvs.width = document.body.clientWidth;
        cvs.height = document.body.clientHeight;
        var context = cvs.getContext('2d');

        class Point {
            constructor(x,y,color){
                this.x = x;
                this.y = y;
                this.color = color || 'rgba(255,255,255,.6)';
                this.radiu = 5;
            }
            draw(context){
                context.beginPath();
                context.fillStyle= this.color;
                context.arc(this.x, this.y, this.radiu, 0, Math.PI * 2);
                context.fill();                
            }
        }

        //画圆
        // 每个圆形上面的点的数量
        var perCirclePoints = 24;
        // 圆的半径
        var radiu = 300;
        // 偏移量
        var offset = 400;
        //

        var p1 = new Point(0+offset,0+offset);
        p1.draw(context);
        
    </script>
</body>
</html>